#pragma once
#include <iostream>
#include <string>

using namespace std;
class Vehicle 
{
private:
	string brand;
	int year;
	double purchasingPrice;
	double sellingPrice;

public:

	Vehicle(void)
	{
		string brand = "";
		int year = 0;
		double purchasingPrice = 0.0;
		double sellingPrice = 0.0;
	}
	Vehicle (string brand, int year, double purchasingPrice , double sellingPrice)
	{
		this-> brand = brand;
		this-> year = year;
		this-> purchasingPrice = purchasingPrice;
		this-> sellingPrice = sellingPrice;
	}

	~Vehicle(void)
	{
	}

	string GetBrand () { return brand;}
	int GetYear () { return year;}
	double GetPurchasingPrice() { return purchasingPrice;}
	double GetSellinPrice() { return sellingPrice;}

	void SetBrand(string brand) { this-> brand = brand;}
	void SetYear(int year) { this-> year= year;}
	void SetPurchasingPrice(double purchasingPrice) { this-> purchasingPrice = purchasingPrice;}
	void SetSellingPrice(double sellingPrice) { this-> sellingPrice = sellingPrice;}

	void Read()
	{
		cout <<"Brand: ";
		getline(cin , brand);
		cout <<"Year: ";
		cin >> year;
		cout <<"PurchasingPrice: ";
		cin >>purchasingPrice;
		cout <<"SellingPrice: ";
		cin>> sellingPrice;
	}
	void Write()
	{
		cout << brand << "," << year << "," << purchasingPrice << "," << sellingPrice << endl;
	}

	friend ostream &operator << (ostream & out ,const Vehicle & v)
	{
		out << "(";
		out << v.brand <<",";
		out << v.year << ",";
		out << v.purchasingPrice << ",";
		out << v.sellingPrice ;
		out << ")";
		return out;
	}

	friend istream &operator >> (istream & in , Vehicle & v)
	{
		string s;
		getline(in , s, '(');
		getline(in , v.brand ,',');
		in >> v.year;
		getline( in, s, ',');
		in >> v.purchasingPrice;
		getline( in, s, ',');
		in >> v.sellingPrice;
		getline(in, s , ')');
		return in;
	}
	 

};

